Welcome!

Quantitative Text Analysis

2024-01-17

Introductions

Overview

  • Course goals
  • Approach
  • Resource setup
  • Getting help

Course goals

Data literacy

Identify, interpret and evaluate data analysis procedures and results

Research skills

Design, implement, and communicate quantitative research

Reproducible workflows

Apply programmatic strategies to develop and collaborate on reproducible research projects

Approach

Resource setup

Install software

Create accounts

Getting started: R + RStudio

One time:

  1. Open Docker Desktop
  2. Search for the qtalr/lin380 image
  3. Run the image (with password)
  4. Open the container in web browser
  5. Log in to RStudio Server (with password)

To start working:

  1. Open Docker Desktop
  2. Start the container
  3. Open the container in web browser
  4. Log in to RStudio Server (with password)

Getting started: Git + GitHub

One time:

  1. Open RStudio
  2. Create a new project from version control
  3. Select Git
  4. Enter the repository URL (*.git)
  5. Create a new project

Random coding slide

# Load packages
library(tidyverse)
library(tidytext)

# Create data frame with a few sentences and a document id
df <- tibble(
  doc_id = c(1, 2, 3, 4, 5, 6),
  text = c(
    "The quick brown fox jumps over the lazy dog.",
    "The five boxing wizards jump quickly.",
    "Pack my box with five dozen liquor jugs.",
    "How vexingly quick daft zebras jump!",
    "Bright vixens jump; dozy fowl quack.",
    "Jackdaws love the big sphinx of quartz."
  )
)

# Preview
df
> # A tibble: 6 × 2
>   doc_id text                                        
>    <dbl> <chr>                                       
> 1      1 The quick brown fox jumps over the lazy dog.
> 2      2 The five boxing wizards jump quickly.       
> 3      3 Pack my box with five dozen liquor jugs.    
> 4      4 How vexingly quick daft zebras jump!        
> 5      5 Bright vixens jump; dozy fowl quack.        
> 6      6 Jackdaws love the big sphinx of quartz.

Load the necessary packages

Create a data frame with a few sentences and a document id

Preview the data frame